package com.warmheart.core.combine.enums;

import java.util.HashMap;
import java.util.Map;

/**
 * 
 * @ClassName: JoinValueTypeEnum
 * @Description: 连接值类型
 * @author ZhangJianyang
 * @date 2025-06-16 09:37:02
 *
 */
public enum JoinValueTypeEnum {

    COLUMN("column", "表格列"), VALUE("value", "值");

    private static final Map<String, JoinValueTypeEnum> map = new HashMap<String, JoinValueTypeEnum>();

    static {
        for (JoinValueTypeEnum obj : JoinValueTypeEnum.values()) {
            map.put(obj.value, obj);
        }
    }

    // 枚举值
    private String value;

    // 描述
    private String desc;

    private JoinValueTypeEnum(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static JoinValueTypeEnum fromString(String valueStr, JoinValueTypeEnum... defaultEnum) {
        JoinValueTypeEnum obj = map.get(valueStr);
        if (obj == null && defaultEnum != null && defaultEnum.length > 0)
            return defaultEnum[0];
        return obj;
    }

    public String getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

}
